-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add features in get-dependent-files.ts #1525
Conversation
let fileBaseName = path.basename(fileName, '.ts'); | ||
return files | ||
.filter((file) => { | ||
if (path.extname(path.basename(file, '.ts')) === '.spec') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that getDependentFiles
shouldn't lie to you. Return the spec here as well, and filter it out when you're actually using it.
4b8f613
to
cd02683
Compare
* @return absolute paths of '.html/.css/.sass/.spec.ts' files associated with the given file. | ||
* | ||
*/ | ||
export function getAllCorrespondingFiles(fileName: string): Promise<string[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we validate in here that the file is actually a .component
file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No tests for this function?
LGTM pending 2 comments. |
52bd322
to
823e53e
Compare
@@ -75,6 +75,35 @@ export function hasIndexFile(dirPath: string): Promise<Boolean> { | |||
} | |||
|
|||
/** | |||
* Function to get all the templates, stylesheets, and spec files of a given component unit | |||
* Assumption: When any component/service/pipe unit is generated, Angular CLI has a blueprint for | |||
* creating associated files with the name of the generated unit. So, there are two |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't indent so far over here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will 2 spaces under 'Assumption: ' do?
aaf1d5b
to
a32f7b9
Compare
add logic to filter out spec file associated with the given component unit and all index files while getting all dependent files add utlity function to get all the files (.html/stylesheets/.spec.ts) associated with the given component unit change the constructor method of the class ModuleResolver (add 'rootPath' as an additional parameter)
a32f7b9
to
77a7662
Compare
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
add logic to filter out spec file associated with the given component unit and all index files while getting all dependent files
add utlity function to get all the files (.html/stylesheets/.spec.ts) associated with the given component unit
change the constructor method of the class ModuleResolver (add 'rootPath' as an additional parameter)